package com.luych.toolbox.data.service.convert;

import com.luych.toolbox.common.feign.view.data.service.DataTransporterPlanView;
import com.luych.toolbox.common.service.base.BaseConvert;
import com.luych.toolbox.data.service.entity.DataTransporterPlan;
import org.springframework.beans.BeanUtils;

public class DataTransporterPlanEntityToView implements BaseConvert<DataTransporterPlan, DataTransporterPlanView> {

    @Override
    public DataTransporterPlanView target() {
        return new DataTransporterPlanView();
    }

    @Override
    public void accept(DataTransporterPlan source, DataTransporterPlanView target) {
        BeanUtils.copyProperties(source, target, "tables", "tableMap");
        target.setTables(source.getTableMap());
    }
}
